Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 665c048e79b6859d85466700ac93933dbaabab8b


Parents : f04c1e3
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-11-24T16:35:13+01:00

Updated build

Changes

3 files changed, 12 insertions(+), 7 deletions(-)

M Makefile +5 -4
M setup.py +6 -3

Diff

diff --git a/LXST/Platforms/windows.c b/LXST/Platforms/windows.c
new file mode 100644
index 0000000..7efb938
--- /dev/null
+++ b/LXST/Platforms/windows.c
@@ -0,0 +1 @@
+void PyInit_filterlib(void) { }
\ No newline at end of file

diff --git a/Makefile b/Makefile
index bf49b54..27f96ae 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ all: release
clean:
@echo Cleaning...
- -sudo rm -rf ./build
+ -rm -rf ./build
-rm -rf ./dist
-rm -r ./LXST/__pycache__
@@ -20,10 +20,11 @@ create_symlinks:
build_wheel:
cp ./lib/static/* ./LXST/
+ touch ./skip_extensions
python3 setup.py sdist bdist_wheel
- -(rm ./LXST/*.so)
- -(rm ./LXST/*.dll)
- -(rm ./LXST/*.dylib)
+ rm ./skip_extensions
+ -@(rm ./LXST/*.so)
+ -@(rm ./LXST/*.dll)
native_libs:
./march_build.sh

diff --git a/setup.py b/setup.py
index a30bb44..eb5413e 100644
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,8 @@ from setuptools.command.build_ext import build_ext
import os
import platform
-if "SKIP_EXTENSIONS" in os.environ: BUILD_EXTENSIONS = False
-else: BUILD_EXTENSIONS = True
+if os.path.isfile("./skip_extensions"): BUILD_EXTENSIONS = False
+else: BUILD_EXTENSIONS = True
if BUILD_EXTENSIONS: print(f"Building LXST with native extensions...")
else: print(f"Building LXST without native extensions...")
@@ -13,7 +13,10 @@ else: print(f"Building LXST without native extensions...")
with open("README.md", "r") as fh: long_description = fh.read()
exec(open("LXST/_version.py", "r").read())
-if BUILD_EXTENSIONS: extensions = [ Extension("LXST.filterlib", sources=["LXST/Filters.c"], include_dirs=["LXST"], language="c"), ]
+c_sources = ["LXST/Filters.c"]
+if os.name == "nt": c_sources.append("LXST/Platforms/windows.c")
+
+if BUILD_EXTENSIONS: extensions = [ Extension("LXST.filterlib", sources=c_sources, include_dirs=["LXST"], language="c"), ]
else: extensions = []
packages = setuptools.find_packages(exclude=[])


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────